package design.patterns.create.singleton;

/**
 * 懒汉单例，线程不安全
 */
public class Singleton {

    private static Singleton instance;
    private Singleton (){}
    //当多个线程同时访问，可能创建多个不同的对象
    public static Singleton getInstance() {
        if (instance == null) {
            instance = new Singleton();
        }
        return instance;
    }
}
